<?php /* Smarty version 2.6.26, created on 2011-02-16 17:21:41
         compiled from admin/submodules/services.tab.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'string_format', 'admin/submodules/services.tab.html', 73, false),array('modifier', 'date_format', 'admin/submodules/services.tab.html', 75, false),)), $this); ?>
<script type="text/javascript">
<!--<?php echo '
$(document).ready
(
    function()
    {
	$(\'div.dialog#detail\').dialog
	(
	    \'option\',
	    {
		title:	\'Формирование детализации\',
		resizable:	false,
		width:	800
	    }
	);

	$(\'input#detail-button\').click(function(){$(\'div.dialog#detail\').dialog(\'open\');});

	$(\'table#detail-grid\')
	    .jqGrid
	    ({
		colNames:	[\'Номер\',\'Назначение\',\'Продолжительность\',\'Стоимость\',\'Себестоимость\',\'Направление\'],
		colModel:
		[
		    {name:\'phone_number\',width:100},
		    {name:\'phone_dest\',width:100},
		    {name:\'duration\',width:90},
		    {name:\'cost\',width:120},
		    {name:\'selfcost\',width:120},
		    {name:\'direction\',width:250}
		]
	    });
    }
);
'; ?>
-->
</script>

<div class="dialog" id="detail">
    <center>Период с <input type="text" class="date" id="detail-start"/> по <input type="text" class="date" id="detail-end"/></center>
    <table id="detail-grid"></table>
    <div id="detail-grid-pager"></div>
</div>

<!-- Таблица списка услуг -->
<table id="service" width="95%" class="ui-widget" rules="all" cellspacing="0">
    <thead class="ui-widget-header">
	<tr>
	    <th rowspan="2">&nbsp;</th>
	    <th rowspan="2">#</th>
	    <th rowspan="2">Услуга</th>
	    <th rowspan="2">Ответственный</th>
	    <th rowspan="2">Стоимость</th>
	    <th rowspan="2">Ежемесячная</th>
	    <th colspan="2">Период действия</th>
	    <th rowspan="2">Номер</th>
	    <th rowspan="2">Тариф</th>
	    <th rowspan="2">Начисления</th>
	    <th rowspan="2">Начисления<br/><small>себестоимость</small></th>
	    <th rowspan="2">&nbsp;</th>
	</tr>
	<tr>
	    <th>Начало</th>
	    <th>Конец</th>
	</tr>
    </thead>
    <tbody>
    <?php $_from = $this->_tpl_vars['services']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['service'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['service']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['service']):
        $this->_foreach['service']['iteration']++;
?>
	<tr class="data-row">
	    <td align="center"><span style="display: none;"><?php echo $this->_tpl_vars['service']['srv_id']; ?>
</span><input type="checkbox" <?php if ($this->_tpl_vars['service']['service_name_id'] != 3): ?>disabled<?php endif; ?>/></td>
	    <td><?php echo $this->_foreach['service']['iteration']; ?>
</td>
	    <td><?php echo $this->_tpl_vars['service']['service_name']; ?>
</td>
	    <td><?php echo $this->_tpl_vars['service']['executive_name']; ?>
</td>
	    <td align="right" style="padding-right: 2em;"><?php echo ((is_array($_tmp=$this->_tpl_vars['service']['cost'])) ? $this->_run_mod_handler('string_format', true, $_tmp, '%0.2f') : smarty_modifier_string_format($_tmp, '%0.2f')); ?>
</td>
	    <td align="center"><img src="images/icons/<?php if ($this->_tpl_vars['service']['monthly'] == 1): ?>tick_16.png<?php else: ?>block_16.png<?php endif; ?>"/></td>
	    <td align="center"><?php if ($this->_tpl_vars['service']['start_date'] > 0): ?><?php echo ((is_array($_tmp=$this->_tpl_vars['service']['start_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
<?php else: ?>&mdash;<?php endif; ?></td>
	    <td align="center"><?php if ($this->_tpl_vars['service']['stop_date'] > 0): ?><?php echo ((is_array($_tmp=$this->_tpl_vars['service']['stop_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
<?php else: ?>&mdash;<?php endif; ?></td>

	    	    <?php if ($this->_tpl_vars['service']['service_name_id'] == 3): ?>
	    <td align="center"><?php echo $this->_tpl_vars['service']['phone_number']; ?>
</td>
	    <td align="center"><?php echo $this->_tpl_vars['service']['rate_name']; ?>
</td>
	    <td align="center" colspan="2">&mdash;</td>
	    <?php else: ?>
	    <td align="center" colspan="4">&mdash;</td>
	    <?php endif; ?>

	    <td align="center"><a href="service-delete.php?id=<?php echo $this->_tpl_vars['service']['srv_id']; ?>
"><img src="images/icons/delete_16.png" border="0"/></a></td>
	</tr>
    <?php endforeach; else: ?>
	<tr><td colspan="8" align="center"><i>нет услуг</i></td></tr>
    <?php endif; unset($_from); ?>
    </tbody>
</table>
<br/><br/>
<a href="javascript:void(0)" id="service-add"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Добавить услугу</a>
<br/><br/>
<input type="button" value="Детализация" class="button" id="detail-button"/>